<?php
$rawAccountOjects = v('rawAccountOjects');
$state = v('state');
?>

<div class="container">
	<div class="row-fluid">
		Open this URL to get your SNS account(s):http://sns.i4sp.cn:8082/en/page/home/?payload={"ef_universe_id":"Your Universe ID"}
		<ul class="thumbnails">
		<li class="navbar-inner span4">
			<h5>Sina Weibo</h5>
		<?php if(isset($rawAccountOjects['weibo'])): ?>
			<div class="thumbanil" style="padding-top:10px;">
				<div class="span3" style="margin-bottom:10px;">
					<a href="<?php p(url(uri('/Html/Page.Weibo.html'))); ?>" target="_blank"><img style="height:50px;" class="img-polaroid" src="<?php p($rawAccountOjects['weibo']->getAvatar()); ?>" /></a>
				</div>
				<div class="span8">
					<a href="<?php p(url(uri('/Html/Page.Weibo.html'),array('payload'=>'{\"ef_universe_id\":\"'.$state.'\"}'))); ?>" target="_blank"><?php p($rawAccountOjects['weibo']->getScreenName()); ?></a> | 
					<a href="<?php p(url('api/json/Account.disconnect?ef_user_id=222&sns=' . SOCIAL_NETWORK_WEIBO . '&ef_universe_id=' . 'demo_cn')); ?>">Remove</a>
					<p>Friends:<?php p($rawAccountOjects['weibo']->getFriendsCount()); ?> | Followers:<?php p($rawAccountOjects['weibo']->getFollowersCount()); ?></p>
				</div>
				<div>
			</div>
			<div class="span1">

			</div>
		<?php else: ?>
			<div class="thumbanil" style="padding-top:10px;">
				<a class="btn" href="<?php p(url('api/json/Account.startConnection') . '?payload=' . json_encode(array('sns'=>SOCIAL_NETWORK_WEIBO ,'ef_user_id'=>'222','ef_universe_id'=>'demo_cn','urlToEf'=>'http://sns.i4sp.cn/'))); ?>">Connect</a>
			</div>
			<div class="span1">
			</div>
		<?php endif; ?>
		</li>
<!--
		<li class="navbar-inner span4">
			<h5>Tencent Weibo</h5>
		<?php if(isset($rawAccountOjects['tweibo'])): ?>
			<div class="thumbanil" style="padding-top:10px;">
				<div class="span3" style="margin-bottom:10px;">
					<a href="<?php p(url(uri('/Html/Page.Weibo.html'))); ?>" target="_blank"><img style="height:50px;" class="img-polaroid" src="<?php p($rawAccountOjects['tweibo']->getAvatar()); ?>" /></a>
				</div>
				<div class="span8">
					<a href="<?php p(url(uri('/Html/Page.Weibo.html'),array('state'=>$state))); ?>" target="_blank"><?php p($rawAccountOjects['tweibo']->getScreenName()); ?></a> | 
					<a href="<?php p(url('api/json/Account.disconnect?efId=222&socialNetwork=' . SOCIAL_NETWORK_TWEIBO . '&state=' . 'demo_cn')); ?>">Remove</a>
					<p>Friends:<?php p($rawAccountOjects['tweibo']->getFriendsCount()); ?> | Followers:<?php p($rawAccountOjects['tweibo']->getFollowersCount()); ?></p>
				</div>
				<div>
			</div>
			<div class="span1">

			</div>
		<?php else: ?>
			<div class="thumbanil" style="padding-top:10px;">
				<a class="btn" href="<?php p(url('api/json/Account.startConnection?socialNetwork=' . SOCIAL_NETWORK_TWEIBO . '&efId=222&state=demo_cn&urlToEf=http://sns.splio.local/')); ?>">Tencent weibo</a>
			</div>
			<div class="span1">
			</div>
		<?php endif; ?>
		</li>

		<li class="navbar-inner span4">
			<h5>Renren</h5>
		<?php if(isset($rawAccountOjects['renren'])): ?>
			<div class="thumbanil" style="padding-top:10px;">
				<div class="span3" style="margin-bottom:10px;">
					<a href="<?php p(url(uri('/Html/Page.Renren.html'))); ?>" target="_blank"><img style="height:50px;" class="img-polaroid" src="<?php p($rawAccountOjects['renren']->getAvatar()); ?>" /></a>
				</div>
				<div class="span8">
					<a href="<?php p(url(uri('/Html/Page.Renren.html'))); ?>" target="_blank"><?php p($rawAccountOjects['renren']->getScreenName()); ?></a> | 
					<a href="<?php p(url('api/json/Account.disconnect?efId=222&socialNetwork=' . SOCIAL_NETWORK_RENREN . '&state=' . 'demo_cn')); ?>">Remove</a>
					<p>Friends:<?php p($rawAccountOjects['renren']->getFriendsCount()); ?> | Statuses:<?php p($rawAccountOjects['renren']->getStatusesCount()); ?></p>
				</div>
			</div>
			<div class="span1">
			</div>
		<?php else: ?>
			<div class="thumbanil" style="padding-top:10px;">
				<a class="btn" href="<?php p(url('api/json/Account.startConnection?socialNetwork=' . SOCIAL_NETWORK_RENREN . '&efId=222&state=demo_cn&urlToEf=http://sns.splio.local/')); ?>">Renren</a>
			</div>
			<div class="span1">
			</div>
		<?php endif; ?>
		</li>
	-->
		<li class="navbar-inner span4">
			<h5>WeChat</h5>
		<?php if(isset($rawAccountOjects['wechat'])): ?>
			<div class="thumbanil" style="padding-top:10px;">
				<div class="span3" style="margin-bottom:10px;">
					<a href="<?php p(url(uri('/Html/Page.Wechat.html'))); ?>" target="_blank"><img style="height:50px;" class="img-polaroid" src="<?php p($rawAccountOjects['wechat']->getAvatar()); ?>" /></a>
				</div>
				<div class="span8">
					<a href="<?php p(url(uri('/Html/Page.Wechat.html')) . '?payload={"appId":"' . $rawAccountOjects['wechat']->getWechatAppId() . '","ef_universe_id":"'.$rawAccountOjects['wechat']->getUniverse().'"}'); ?>" target="_blank"><?php p($rawAccountOjects['wechat']->getWechatAppId()); ?></a> | 
					<a href="<?php p(url('api/json/Account.disconnect?ef_user_id=222&sns=' . SOCIAL_NETWORK_RENREN . '&ef_universe_id=' . 'demo_cn')); ?>">Remove</a>
				</div>
			</div>
			<div class="span1">
			</div>
		<?php else: ?>
			<div class="thumbanil" style="padding-top:10px;">
				<form action="<?php p(url('api/json/Account.startConnection') . '?payload=' . json_encode(array('sns'=>SOCIAL_NETWORK_WECHAT ,'ef_universe_id'=>'demo_cn','urlToEf'=>'http://sns.i4sp.cn/'))); ?>" method="POST">
					<lable>AppID</lable><input name="appId" type="text" /><br>
					<lable>Secret</lable><input name="appSecret" type="text" /><br>
					<input type="submit" value="Connect">
				</form>
			</div>
			<div class="span1">
			</div>
		<?php endif; ?>
		</li>
	</ul>
	</div>
</div>
